package day20170419.interfaces;

public class AddImpl implements Add{

	@Override
	public int add(Sum sum) throws Exception{
		int x = sum.getX();
		int y = sum.getY();
		if(x < 0 || y < 0){
			throw new Exception("不能为0");
		}else{
			return x + y;
		}
	}

}
